<template>
  <div class="app-container">
    <el-tree
      class="filter-tree"
      :data="categoryData"
      :props="defaultProps"
      default-expand-all
      ref="tree"
    ></el-tree>
  </div>
</template>
<script>
import { apiServiceCategoryTree } from "@/api/serviceCategory";

export default {
  data() {
    return {
      categoryData: [],
      defaultProps: {
        children: "children",
        label: "categoryName",
        value: "categoryId",
      },
    };
  },
  mounted(){
    this.getData()
  },
  methods: {
    getData() {
      apiServiceCategoryTree({
        serviceCategoryType: this.categoryType,
      }).then((response) => {
        this.categoryData = response.data;
      });
    },
  },
};
</script>
<style scoped lang="scss">
.content {
  height: calc(100vh - 200px);
  overflow: auto;
}
.tab-content {
  height: calc(100vh - 270px);
  overflow: auto;
}
</style>
